package com.bigfire.dtm.domain.ability.aggregate;

public class CompetenceModel {
    //全局常量
    public static final double allTaskNum = 100;
    public static final double allProgrammerNum = 34;
    public static final double allTechNum = 9;
    public static final double allTrainNum = 6;

    //个人产出常量
    double normalDoneEfficiency = 0.5;
    double normalDoneRate = 0.5;
    double normalInRate = 0.1;
    double normalDelayRate = 1;
    double normalQuality = 0.5;

    //个人费用常量
    double normalFee = 18000;
    double normalLevel = 6;
    double normalFeeLevelRate = 1;

    //个人意愿常量
    double normalBuzRate = 1;
    double normalTechEfficiency = 0.8;

    //个人能力常量
    double normalCapacity = 1;


    public double getDoneEfficiency(double inTime, double inNum) {
        double rate = inTime / inNum;
        return normalDoneEfficiency - rate;
    }

    public double getDoneRate(double inDoneNum, double inReceiveNum) {
        double rate = inDoneNum / inReceiveNum;
        return rate - normalDoneRate;
    }

    public double getInRate(double inReceiveNum, double inAllNum) {
        double rate = inReceiveNum / inAllNum;
        return rate - normalInRate;
    }

    public double getDelayRate(double inTime, double inNum) {
        double rate = inTime / inNum;
        return normalDelayRate - rate;
    }

    public double getQuality(double inTime, double inNum) {
        double rate = inTime / inNum;
        return normalQuality - rate;
    }

    public double getFeeRate(double inFee, double inLevel) {
        double feeLevel = inFee / inLevel;
        //归一化
        double feeLevelRate = feeLevel / (normalFee / normalLevel);

        return normalFeeLevelRate - feeLevelRate;
    }

    public double getBuzRate(double inRealTime, double inCapacity) {
        double rate = inRealTime / inCapacity;
        return rate - normalBuzRate;
    }

    public double getTechEfficiency(double inEffectTime, double inRealTime) {
        double rate = inEffectTime / inRealTime;
        return rate - normalTechEfficiency;
    }

    public double getCapability(double inCapacity) {
        return inCapacity - normalCapacity;
    }


}
